from enum import Enum

__all__ = ['EventTypes']


class EventTypes(Enum):
    # When an Entity is appended.
    # Args: (entity: Entity, pos: Tuple[int, int])
    append_entity = 1 << 0

    # When an Entity is moved.
    # Args: (entity: Entity, origpos: Tuple[int, int], stoppos: Tuple[int, int])
    move_entity = 1 << 1

    # When an entity is selected.
    # Args: (entity: Entity, pos: Tuple[int, int])
    # Return: print (optional): str
    select_entity = 1 << 2

    # Show the entities at pos.
    # Args: (pos: Tuple[int, int])
    # Return: print: str
    print_pos = 1 << 3

    # Get the status of an entity.
    # Args: (entities: Iterable[Entity])
    # Return: status: dict
    # Format: {
    #     in_progress: (cls: Type, total_time: int, left_time: int),
    #     actions_left: int | None,
    #     inventory: [object, ...]
    # }
    get_stat = 1 << 4

    # An entity attacks another.
    # Args: (attacker: Entity, attacked: Entity)
    attack = 1 << 5

    # A wood is mined.
    # Args: (miner: Entity, pos: Tuple[int, int])
    mine_wood = 1 << 6

    # A stone is mined.
    # Args: (miner: Entity, pos: Tuple[int, int])
    mine_stone = 1 << 7

    # A metal is mined.
    # Args: (miner: Entity, pos: Tuple[int, int])
    mine_metal = 1 << 8

    # A time cycle passed.
    # Return: print (optional): str
    tick = 1 << 9

    # Start a research in lab.
    # Return: success: bool
    research = 1 << 10
